package com.ruoyi.reportsnhnt.mapper;

import com.ruoyi.reportsnhnt.domain.ReportSnhntKwlqdBaDetail;
import com.ruoyi.reportsnhnt.domain.vo.ReportSnhntKwlqdBaDetailVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 水泥混凝土抗弯拉强度试验检测记录详情Mapper接口
 *
 * @author zxs
 * @date 2024-06-21
 */
public interface ReportSnhntKwlqdBaDetailMapper extends BaseMapperPlus<ReportSnhntKwlqdBaDetailMapper, ReportSnhntKwlqdBaDetail, ReportSnhntKwlqdBaDetailVo> {

    @Select("select * from report_snhnt_kwlqd_ba_detail where excel_id = #{excelId} and del_flag = 0")
    List<ReportSnhntKwlqdBaDetail> selectByExcelId(Long excelId);

    @Delete("delete from report_snhnt_kwlqd_ba_detail where excel_id = #{excelId}")
    void deleteByExcelId(Long excelId);
    @Select("select kwlqd.* from report_snhnt_kwlqd_ba_detail kwlqd,syrw_ref_report_excel ref,syrw_bi_excel_type bi where ref.excel_type_id = bi.excel_type_id and kwlqd.excel_id = ref.excel_id " +
        " and ref.report_id = (select report_id from syrw_ref_report_excel where excel_id = #{excelId}) and bi.label ='snhntkwlqd' ")
    List<ReportSnhntKwlqdBaDetail> selectByBgExcelId(Long excelId);
}
